<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
		 pageEncoding="UTF-8"%>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="stylesheet" href="../css/bootstrap.min.css" />
	<script src="../js/jquery.min.js"></script>
	<script src="../js/bootstrap.min.js"></script>
	<script type="text/javascript">
		//第一种方案: 异步方案, 页面一加载就发送ajax请求到servlet, 查询返回json数据,
		//在页面上利用js操作dom结构, 将数据填充到页面展示
		//$(function () {
		//$.get("/type", "", function (data) {
		//接收data返回的商品分类数据, 利用js将数据操作显示到dom结构上
		//});

		//});
	</script>
	<title>商品分类</title>
</head>
<body>
<div class="row" style="width:98%;margin-left: 1%;">
	<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
		<div class="panel panel-default">
			<div class="panel-heading">
				商品类型
			</div>
			<div class="panel-body">
				<div class="row">
					<div class="col-xs-5 col-sm-5 col-md-5 col-lg-5">
						<div class="form-group form-inline">
							<span>商品等级</span>
							<input type="text" name="username" class="form-control">
						</div>
					</div>
					<div class="col-xs-5 col-sm-5 col-md-5 col-lg-5">
						<div class="form-group form-inline">
							<span>商品名称</span>
							<input type="text" name="pubdate" class="form-control">
						</div>
					</div>
					<div class="col-xs-2 col-sm-2 col-md-2 col-lg-2">
						<button type="button" class="btn btn-primary" id="search"><span class="glyphicon glyphicon-search"></span></button>
					</div>
				</div>
				<div style="height: 400px;overflow: scroll;">
					<table id="tb_list" class="table table-striped table-hover table-bordered">
						<tr>
							<td>序号</td><td>类型</td><td>等级</td><td>所属类型</td><td>操作</td>
						</tr>
						<c:forEach items="${goodsTypeList}" var="gtype" varStatus="i">
							<tr>
								<td>${i.count}</td>
								<td>${gtype.name}</td>
								<td>${gtype.level}</td>
								<td>${gtype.parent}</td>
								<td>
									<button>修改</button>&nbsp;&nbsp;
									<button>删除</button>
								</td>
							</tr>
						</c:forEach>

					</table>
				</div>
			</div>

		</div>
	</div>
</div>
</body>
</html>